# Copyright (c) 2019 Presto Labs Pte. Ltd.
# Author: xguo

from coin.exchange.base.kr_rest.product_info import ProductInfo, ProductHolder
from coin.exchange.kraken_futures.kr_rest.futures_product import KrakenFuturesProduct
from coin.exchange.kraken_futures.kr_rest.constants import product_ticksize


def get_holder_from_product(product):
  assert isinstance(product, KrakenFuturesProduct)
  price_ticksize = product_ticksize[product.native_currency_pair]
  product_info = ProductInfo.gen3(price_ticksize=price_ticksize, qty_precision=0)
  return ProductHolder(product, product_info)
